﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

/// <summary>
///CheckEditShow 的摘要说明
/// </summary>
public class CheckEditShow:BaseEditShowField
{
	public CheckEditShow()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    public override IEnumerable<System.Web.UI.Control> GetThisTypeControl(ConfigColumns cCol, string value, bool isEdit)
    {
        CheckBox ctrl = new CheckBox();
        ctrl.ID = cCol.ColumnName + "_EditShow";

        if (isEdit)
        {
            bool boolV = false;
            if (bool.TryParse(value, out boolV))
            {
                ctrl.Checked = boolV;
            }
        }
        else
        {
            bool boolV = false;
            if (bool.TryParse(cCol.AddShowDefaultValue, out boolV))
            {
                ctrl.Checked = boolV;
            }
        }

        yield return ctrl;
    }

    #region IEditShowField 成员

    public IEnumerable<System.Web.UI.Control> GetEditFieldControls(ConfigColumns cCol, string value, bool isEdit)
    {
        throw new NotImplementedException();
    }

    #endregion
}
